﻿@using Abp.Web.Mvc.Extensions
@using MyCompanyName.AbpZeroTemplate.Authorization
@using MyCompanyName.AbpZeroTemplate.Web.Navigation
@{
    ViewBag.CurrentPageName = PageNames.App.Common.OrganizationUnits;
}
@section Styles
{
    @Html.IncludeStyle("~/Areas/Mpa/Views/OrganizationUnits/Index.min.css")
}
@section Scripts
{
    @Html.IncludeScript("~/Areas/Mpa/Views/OrganizationUnits/Index.js")
}
<div class="row margin-bottom-5">
    <div class="col-xs-12">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("OrganizationUnits")</span> <small>@L("OrganizationUnitsHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-lg-6">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <span class="caption-subject bold uppercase">
                        @L("OrganizationTree")
                    </span>
                </div>
                <div class="actions">
                    @if (IsGranted(AppPermissions.Pages_Administration_OrganizationUnits_ManageOrganizationTree))
                    {
                        <a id="AddRootUnitButton" class="btn btn-circle btn-default">
                            <i class="fa fa-plus"></i> @L("AddRootUnit")
                        </a>
                    }
                </div>
            </div>
            <div class="portlet-body">
                <div id="OrganizationUnitEditTree"></div>
                <div id="OrganizationUnitTreeEmptyInfo" ng-if="!vm.organizationTree.unitCount" class="text-muted">
                    @L("NoOrganizationUnitDefinedYet")
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-6">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <span class="caption-subject bold uppercase">
                        @L("Members")
                        <span id="SelectedOuRightTitle"></span>
                    </span>
                </div>
                <div class="actions">
                    @if (IsGranted(AppPermissions.Pages_Administration_OrganizationUnits_ManageMembers))
                    {
                        <a id="AddUserToOuButton" class="btn btn-circle btn-default">
                            <i class="fa fa-plus"></i> @L("AddMember")
                        </a>
                    }
                </div>
            </div>
            <div class="portlet-body">
                <div id="OuMembersTable"></div>
                <div id="OuMembersEmptyInfo" class="text-muted">
                    @L("SelectAnOrganizationUnitToSeeMembers")
                </div>
            </div>
        </div>
    </div>
</div>
